﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProgramShortcuts.Components.Services;

namespace ProgramShortcuts.Components.Functions
{
	public class NewLineFunctionState : IFunctionState
	{		
			IClearScreen _ClearScreen;
			IWriteString _WriteString;
			public NewLineFunctionState( IClearScreen clearScreen, IWriteString writeString )				
			{				
				_ClearScreen = clearScreen;
				_WriteString = writeString;
			}
			
			#region IFunctionstate Members

			public void InteractWithUser( ConsoleKeyInfo consoleKeyInfo )
			{
				if ( consoleKeyInfo.Key == ConsoleKey.Enter )
				{
					_WriteString.Write( "\r\n" );
				}
			}

			public void InformUserOfCurrentState()
			{
				_ClearScreen.ClearCurrentLine();
				_WriteString.Write( "NewLine" );
			}

			#endregion
	}
}
